package com.briup.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Auther: liao
 * @Date: 2022/9/11-09-11-15:04
 * @Description：分页必须有的分页拦截器，为什么有这个呢
 * 是因为分页是需要limit 1,5  这个这种的，这种也叫拦截凭追加功能
 */
@Configuration
public class MybatisPlusConfig {
    @Bean
    public MybatisPlusInterceptor  MybatisPlusInterceptor(){
        MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
        mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return mybatisPlusInterceptor;
    }
}
